package cn.com.captureNetPacket.model;


public class StaticVar {
	public static enum   DEVICE_TYPE {
		UNKNOW,STATION, DN, OTHER, IVR;
		public static DEVICE_TYPE valueOf(int ordinal) {
			if (ordinal < 0 || ordinal >= values().length) {
				throw new IndexOutOfBoundsException("Invalid ordinal");
			}
			return values()[ordinal];
		}
	}


	/**
	 *  网卡状态
	 */
	public static enum NETWORKCARD_STATUS {

		/**
		 * -1 网卡关闭。
		 */
		CLOSED(-1,"网卡关闭"),

		/**
		 * 1 Initializing 初始化中
		 */
		INITIALIZING(1,"初始化网卡中"),

		/**
		 * 2 网卡开启失败。
		 */
		OPEN_FAIL(2,"网卡开启失败"),
		/**
		 * 3 网卡成功打开。
		 */
		OPENED(3,"网卡已打开"),

		/**
		 * 11 准备抓包运行
		 */
		PRE_RUN(11,"准备抓包运行"),

		/**
		 * 12 抓包运行中
		 */
		RUNNING(12,"抓包运行中"),
		/**
		 * 13  抓包运行结束
		 */
		AFTER_RUN(13,"抓包运行结束"),
		/**
		 * 14  抓包运行异常
		 */
		RUN_EXCEPTION(14,"抓包运行异常"),
		/**
		 * 0 Destroying。关闭前的状态销毁中.
		 */
		DESTRYOYING(0,"关闭前的状态销毁释放资源中");

		private int value = -1;
		private String desciption = "NA";
		private NETWORKCARD_STATUS(int value,String desc) {
			this.value = value;
			this.desciption = desc;
		}
		public static NETWORKCARD_STATUS valueOf(int ordinal) {
			for(NETWORKCARD_STATUS ot:values()){
				if(ordinal==ot.value){
					return ot;
				}
			}
			return CLOSED;
		}

		public int getValue() {
			return this.value;
		}
		public String getDesciption() {
			return this.desciption;
		}
	}
}
